package com.hspedu.exception_;

/**
 * @author DL5O
 * @version 1.0
 */
public class ClassCastException_ {
    public static void main(String[] args) {
        A b= new B();//向上转型
        B b2 = (B)b;//向下转型，这里都是OK的
        C c2 = (C)b;//这里会抛出异常 ClassCastException



    }
}

class A {

}

class B extends A {

}

class C extends A {

}
